﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class orgman_models_new : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MasApp.BLL.Check.CheckLogin();
        tb_modelname.Focus();
    }
    protected void LinkButton1_Click(object sender, EventArgs e)
    {
        #region Model mod
        MasApp.Model.model mod = new MasApp.Model.model();
        mod.Modelname = tb_modelname.Text;
        mod.Target = tb_target.Text;
        mod.Description = tb_description.Text;
        mod.Creator = Session["username"].ToString();
        mod.Organizationid = Convert.ToInt32(Session["organizationid"].ToString());
        #endregion
        #region 显示结果
        if (MasApp.BLL.reg.RegModelbool(mod))
        {
            MasApp.BLL.ResponseHelper.alert("添加成功！\\n请及时完善模型的准则层与指标层信息，然后提交模型；\\n只有提交了的模型才能在实际项目中使用。", "editlist.aspx");
            
            
        }
        else
        {
            MasApp.BLL.ResponseHelper.alert("操作失败！");
        }
        tb_description.Text = "";
        tb_modelname.Text = "";
        tb_target.Text = "";
        #endregion
    }
}
